//时间格式转化
export function formatterTime(type,time){
  if(time === ''){
    return ;
  }
  var formatter = '';
  if(type === 'date'){
    formatter = 'yyyy-MM-dd';
  }else if(type === 'time'){
    return getTimeFormatDate(time);
  }else{
    formatter = type;
  }
  var date = new Date(time);
  return formatter.replace(/yyyy/g,date.getFullYear()).replace(/MM/g,date.getMonth() + 1).replace(/dd/g,date.getDate()).replace(/hh/g,date.getHours()).replace(/mm/g,date.getMinutes()).replace(/ss/g,date.getSeconds());
}
